﻿@model IEnumerable<tutors_clus.Models.comment>
@using tutors_clus.Models;
@{
    ViewBag.Title = "Chi tiết bình luận";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


            @foreach (var item in Model)
            {
                <div class="postbodytop">
                    <h2>@item.title_com</h2>

                    <div class="infoAuthor"><span>
                        @{
                            if(@item.isrepply == true)
                            {
                                @item.course.teacher.fullname_tea
                            }else
                            {
                                if (@item.student.id_stu == WebSecurity.GetUserId(User.Identity.Name))
                                {
                                    <i>Bạn</i>
                                }
                                else
                                {
                                    @item.student.fullname_stu
                                }
                                
                            }
                        }
                 </span> <i>đăng vào @item.createdate</i></div>
                </div>
                <div class="postcontent">@MvcHtmlString.Create(item.content_com)</div>
            }

        <div class="repost">
            <div class="count_com">
                    <div class="count_com">
                        <h2>@ViewBag.count bình luận</h2>
                    </div>
                    <hr />
                    @foreach (var item2 in ViewBag.detail_comment)
                    {
                        <div class="repostbody">
                        <div class="infoAuthor"><span>
                           @{
                            if(@item2.isrepply == true)
                            {
                                @item2.course.teacher.fullname_tea
                            }else
                            {
                                if (@item2.student.id_stu == WebSecurity.GetUserId(User.Identity.Name))
                                {
                                    <i>Bạn</i>
                                }
                                else
                                {
                                    @item2.student.fullname_stu
                                }
                                
                            }
                        }
                        </span> đăng vào @item2.createdate</div>
                    
                        <div class="postcontent">@MvcHtmlString.Create(item2.content_com)</div>
                    </div>  
                    }
                </div>
                <hr />
        </div>
       
        <div class="recomment">
            @using(Html.BeginForm("Add_detail_com","Student",new { id_cou=Model.Select(m=>m.id_cou).FirstOrDefault(), id_com=Model.Select(m=>m.id_com).FirstOrDefault()}))
                {
                    <input type="text" name="contentCom" placeholder="Bình luận" />
                    <input type="submit" name="name" value="Bình luận" />
                }
        </div>
